﻿using AllIsWell.Tests.TestData;
using NUnit.Framework;

namespace AllIsWell.Services.Tests.PageServiceTests
{
    [TestFixture]
    class IsTodaysPageExists : PageServiceTest
    {
        private const int DestinyId = 1;

        [Test]
        public void ShouldReturnTrueIfPageExisitsForToday()
        {
            PageRepositoryMock.Setup(repo => repo.GetPageForToday(DestinyId)).Returns(PageSeed.GetPage());

            var isPageForTodayExists = PageService.IsTodaysPageExists(DestinyId);

            Assert.IsTrue(isPageForTodayExists);
        }

        [Test]
        public void ShouldReturnFalseIfPageNotExistsForToday()
        {
            PageRepositoryMock.Setup(repo => repo.GetPageForToday(DestinyId)).Returns(() => null);

            var isPageForTodayExists = PageService.IsTodaysPageExists(DestinyId);

            Assert.IsFalse(isPageForTodayExists);
        }
    }
}